package com.itlangzi.mybatis.factory;

import com.itlangzi.mybatis.page.Pagination;
import org.apache.ibatis.reflection.factory.DefaultObjectFactory;

import java.util.List;
import java.util.Properties;

public class PaginationFactory extends DefaultObjectFactory {

    @Override
    public void setProperties(Properties properties) {
        super.setProperties(properties);
    }

    @Override
    public <T> T create(Class<T> type) {
        return super.create(type);
    }

    @Override
    public <T> T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs) {
        return super.create(type, constructorArgTypes, constructorArgs);
    }

    @Override
    public <T> boolean isCollection(Class<T> type) {
        if(Pagination.class.isAssignableFrom(type)){
            return true;
        }
        return super.isCollection(type);
    }
}
